<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="c" 
           uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!--引入easyui的样式 -->
<link rel="stylesheet"  type="text/css" href="../themes/default/easyui.css">
<link rel="stylesheet"  type="text/css" href="../themes/icon.css">
<!-- js文件 -->
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../js/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../js/easyui-lang-zh_CN.js"></script>
<title>个人信息</title>
</head>
<body>
<!--修改学生个人信息的按钮事件(洪英杰)-->
<script type="text/javascript">
/**
 * 修改学生个人信息
 */
$(function(){
	/* 弹出修改窗口  */
	$("#modifyinfo").click(function(){
		$("#dlg").dialog("open")
	})
	$("#closemodify").click(function(){
		$('#ff').form('clear');
		$("#dlg").dialog("close");
	})
	/* 点击提交 */
	$("#savemodifyinfo").click(function(){
		$('#ff').form({
		    url:"updateinfo",
		    onSubmit: function(){
		    	return $(this).form('enableValidation').form('validate');
		    },
		    success:function(data){
		    	if(data){
		    		location.reload();
		    	}else{
		    		alert("修改失败");
		    	}
		    }
		});
		// 提交弹出的这个表单    
		$('#ff').submit();
	})
})
</script>
	<!--学生个人信息(洪英杰)-->
	<table id="checkinfo" title="查看个人信息"
	 class="easyui-datagrid"             
     data-options="url:'checkinfo',method:'post'" 
     border="false">
        <thead>
            <tr>              
                <th field="sid" width='80' resizable='false' >学号</th>
                <th field="sname" width='80' resizable='false' >姓名</th>
                <th field="scollege" width='80' resizable='false'>所在学院</th>
                <th field="hid" width='80' resizable='false'>寝室编号</th>
                <th field="ssex" width='80' resizable='false'>性别</th>
                <th field="sage" width='80' resizable='false'>年龄</th>
                <th field="saddress" width='180'resizable='false'>家庭地址</th>
                <th field="sphone" width='140' resizable='false'>联系电话</th>
            </tr>
              </thead>
        	<!--修改按钮(洪英杰)-->
             <div id="toolbar">       
        		<a id="modifyinfo" class="easyui-linkbutton" iconCls="icon-edit" plain="true">修改</a>      
   			 </div>
    	</table>
   			<!--修改学生信息的对话框 (洪英杰)-->
    		<div id="dlg" class="easyui-dialog" title="修改信息" style="width:400px;height:400px;padding:10px"
			data-options="
				closed: 'true',
				iconCls: 'icon-save',
				buttons: '#dlg-buttons',
				maximizable: 'true',
				modal:'true'
			">
			<div class="easyui-panel" style="width: 100%;height:100%">
			<div style="padding: 10px 60px 20px 60px">
				<form id="ff" method="post">
					<table cellpadding="5">
				
						<tr>
							<td>姓名:</td>
							<td><input class="easyui-textbox" type="text" name="sname"
								data-options="required:true" value="${usermodel.sname}"></input></td>
						</tr>
						
						<tr>
							<td>学院:</td>
							<td><input class="easyui-textbox" type="text" name="scollege"
								data-options="required:true" value="${usermodel.scollege}"></input></td>
						</tr>
						<tr>
							<td>性别:</td>
							<td><select class="easyui-combobox" name="ssex"><option value="男">男</option><option value="bg">女</option></td>
						</tr>
						<tr>
							<td>年龄:</td>
							<td><input class="easyui-textbox" type="text" name="sage"
								data-options="required:true,editor:{type:'numberbox'}" value="${usermodel.sage}"></input></td>
						</tr>
						<tr>
							<td>家庭住址:</td>
							<td><input class="easyui-textbox" type="text" name="saddress"
								data-options="required:true" value="${usermodel.saddress}"></input></td>
						</tr>
						<tr>
							<td>联系电话:</td>
							<td><input class="easyui-textbox" type="text" name="sphone"
								data-options="required:true,editor:{type:'numberbox'}" value="${usermodel.sphone}"></input></td>
						</tr>
					
					</table>
				</form>
			</div>
		</div>
	</div>
	<!--提交和取消按钮(洪英杰)-->
	<div id="dlg-buttons">
		<a id="savemodifyinfo" href="#" class="easyui-linkbutton">提交</a>
		<a id="closemodify" href="#" class="easyui-linkbutton">取消</a>
	</div>
      
    
</body>
</html>